
package com.example.seataaccount.controller;

import com.example.seataaccount.mapper.AccountMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName: AccountController
 * @Description: 账户服务：扣钱
 */
@RestController
public class AccountController {

    @Resource
    AccountMapper accountMapper;

    @RequestMapping(value = "/account", method = RequestMethod.GET, produces = "application/json")
    public String account(String userId, int money) {
        accountMapper.updateMoney(userId, money);
        return "SUCCESS";
    }

}
